package com.kldy8.kldyw.web;

import android.content.Intent;
import android.util.Log;

import com.kldy8.kldyw.SystemSet;
import com.kldy8.kldyw.filmfactory.FilmTalent.FilmTalentActivity;
import com.kldy8.kldyw.filmfactory.company.CompanyActivity;
import com.kldy8.kldyw.filmfactory.dteam.DteamListActivity;
import com.kldy8.kldyw.filmfactory.equipment.DeviceActivity;
import com.kldy8.kldyw.filmfactory.shootingvenue.ShootingVenueActivity;
import com.kldy8.kldyw.system.UrlBuilder;

/**
 * Created by user on 2016/10/14.
 */

public class AppWebUrl
{
    //影视首页
    public final static String  MAIN =  UrlBuilder.URL_BASE_API+"/index.php?header=off";
    //影视工厂
    public final static String  URL_MAKE =  UrlBuilder.URL_BASE_API+"/index.php/make?header=off";
    //影视发现
    public final static String  URL_FIND =  UrlBuilder.URL_BASE_API+"/detection?header=off";
    //个人主页
    public final static String  URL_PERSON_MANGER =  UrlBuilder.URL_BASE_API+"/welcome/center?header=off";
    //登录页面
    public final static String  URL_LOGIN =  UrlBuilder.URL_BASE_API+"/user/login";
    //求职
    public final static String  URL_JOB_PERSON_LIST =  UrlBuilder.URL_BASE_API+"/job/person_list";
    //提供职位
    public final static String  URL_JOB_COMPANY_LIST =  UrlBuilder.URL_BASE_API+"/job/company_list";
    //剧组
    public final static String  URL_DTEAM_DTEAM_LIST =  UrlBuilder.URL_BASE_API+"/dteam/dteam_list";
    //场地
    public final static String  URL_PLACE_PLACE_LIST =  UrlBuilder.URL_BASE_API+"/place/place_list";
    //设备列表
    public final static String  URL_DEVICE_DEVICE_LIST =  UrlBuilder.URL_BASE_API+"/device/device_list";
    //公司列表
    public final static String  URL_COMPANY_COMPANY_LIST =  UrlBuilder.URL_BASE_API+"/company/company_list";
    //消息中心
    public static final String URL_MESSAGE = UrlBuilder.URL_BASE_API+"/message";
    //设置
    public static final String URL_USER_SETTING = UrlBuilder.URL_BASE_API+"/user/setting";
    //设置
    public static final String URL_SEARCH_INDEX = UrlBuilder.URL_BASE_API+"/search/index";

    //权限：
//    个人：
//
//    发剧本：权限[作家资料完善（http://www.kldy8.com/user/approve_writer）] http://www.kldy8.com/script/add
    public static final String URL_APPROVE_WRITER = UrlBuilder.URL_BASE_API+"/user/approve_writer";
//    发简历： http://www.kldy8.com/job/person_form
//
//    发设备出售/出租：权限[身份认证（http://www.kldy8.com/user/approve_personal）] http://www.kldy8.com/device/form?type=2[出售]  http://www.kldy8.com/device/form?type=0[出租]
     public static final String URL_APPROVE_PERSONAL= UrlBuilder.URL_BASE_API+"/user/approve_personal";
//    发设备求租：http://www.kldy8.com/device/form?type=0
//
//    发寻求场地：http://www.kldy8.com/place/form?type=0
//
//    发提供场地：权限[身份认证（http://www.kldy8.com/user/approve_personal）]  http://www.kldy8.com/place/form?type=1

//    发剧组：权限[企业认证（http://www.kldy8.com/user/approve_personal）] http:/www.kldy.com/dteam/form
//
//    发直播：权限[身份认证（http://www.kldy8.com/user/approve_personal）] http://www.kldy8.com/live/add

//    剧组中，个人报名剧组：权限[完善演员资料（http://www.kldy8.com/approve_actor）]
     public static final String URL_APPROVE_ACTOR = UrlBuilder.URL_BASE_API+"/approve_actor";
//
//    企业：
     public static final String URL_APPROVE_ENTERPRISE = UrlBuilder.URL_BASE_API+"/user/approve_enterprise";
//
//    发剧本征集：权限[企业认证（http://www.kldy8.com/user/approve_enterprise）] http://www.kldy8.com/levy/add
//
//    发人才招募：权限[企业认证（http://www.kldy8.com/user/approve_enterprise）] http://www.kldy8.com/job/company_form
//
//    发设备出售/出租：权限[企业认证（http://www.kldy8.com/user/approve_enterprise）] http://www.kldy8.com/device/form?type=2[出售]  http://www.kldy8.com/device/form?type=0[出租]
//
//    发设备求租：http://www.kldy8.com/device/form?type=0
//
//    发寻求场地：http://www.kldy8.com/place/form?type=0
//
//    发提供场地：权限[企业认证（http://www.kldy8.com/user/approve_enterprise）]  http://www.kldy8.com/place/form?type=1
//
//    发直播：权限[企业认证（http://www.kldy8.com/user/approve_enterprise）] http://www.kldy8.com/live/add
//
//    发剧组：权限[企业认证（http://www.kldy8.com/user/approve_enterprise）] http:/www.kldy.com/dteam/form
//
//    发项目：权限[企业认证（http://www.kldy8.com/user/approve_enterprise）] 暂无发布

    public static  String createUrl(String url)
    {
        if (url == null)
        {
            return  "";
        }
        String  result = "";
        if (url.contains("?"))
        {
            result =  url+"&device=app";
        }
        else
        {
            result =   url+"?device=app";
        }
        String token = SystemSet.getInstance().getToken();

        if (token!=null && token.length()>0 && !token.equals(""))
        {
            result =  result+"&token="+token;
        }

        return  result;
    }

    public static String  addLatLan(String url)
    {
        if (url == null)
        {
            return  "";
        }
        String  result = "";
        if (url.contains("?"))
        {
            if (url.contains("&"))
            {
                result = url + "&lon=" + SystemSet.getInstance().getLon() + "&lat" + SystemSet.getInstance().getLat();
            }
            else
            {
                result = url + "lon=" + SystemSet.getInstance().getLon() + "&lat" + SystemSet.getInstance().getLat();
            }

        }
        else
        {
            result =  url+"?lon="+SystemSet.getInstance().getLon()+"&lat"+SystemSet.getInstance().getLat();
        }
        Log.e("result",result);
        return  result;

    }
}
